package com.liezh;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liezh
 * @date 2021-3-26
 */
public class SessionUtil {

    private static Map<String, String> session = new HashMap<>();

    public static Map<String, String> getSession() {
        return session;
    }

    public static void setSession(Map<String, String> session) {
        SessionUtil.session = session;
    }

    public static boolean isLogin() {
        Map<String, String> session = getSession();
        return session != null && !session.isEmpty();
    }

    public static void logout() {
        setSession(new HashMap<>());
    }

}
